//package com.example.wlzz.controller;
//import com.example.wlzz.entity.DepartmentWeb;
//import com.example.wlzz.repository.DepartmentWebRepository;
//import com.example.wlzz.service.serviceImpl.SmsServiceImpl;
//import org.jsoup.Connection;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.data.redis.core.StringRedisTemplate;
//import org.springframework.test.context.junit4.SpringRunner;
//import java.io.BufferedReader;
//import java.io.File;
//import java.io.FileInputStream;
//import java.io.InputStreamReader;
//import java.util.HashMap;
//import java.util.Map;
//
//import org.jsoup.Jsoup;
//import org.jsoup.nodes.Document;
//import org.jsoup.nodes.Element;
//import org.jsoup.select.Elements;
//@RunWith(SpringRunner.class)
//@SpringBootTest
//public class MongoliaCrawlerControllerTest2 {
//    @Autowired
//    private SmsServiceImpl smsService;
//    @Autowired
//    private DepartmentWebRepository departmentWebRepository;
//    @Test
//    public void getNowClass()throws Exception{
//        Map<String,String> cookies = new HashMap<>();
//        cookies.put("MYWEBAPP.ASPXAUTH","70EBB10398FD68DA440151801D86F155010D807DED22ADCBA8920B34537D5A68BCC50E85677F5EE492191D79C7A32855CCC9F80963BD0DCB2C9B456EEF0B5EAC50A1F4AA1EAE6AE1929338FFC6BA01236A63072BDF6A7DF1B31AD0C93CB6D866953867715EA362EB1203C9114FD48D14488B0ADD5F3090818D93F000B701D93D6A17090F36A506C9929D99D325D5B391");
//        Map<String,String> headMap = new HashMap<>();
//        headMap.put("Connection","keep-alive");
//        headMap.put("Host","wlkt.nuist.edu.cn");
//        //text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
//        headMap.put("Upgrade-Insecure-Requests","1");
//        headMap.put("Accept-Encoding","gzip, deflate");
//        headMap.put("Accept-Language","zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2");
//        headMap.put("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
//        headMap.put("User-Agent", "Mozilla/5.0 (Windows NT 6.1; W…) Gecko/20100101 Firefox/62.0");
//        Connection.Response login =  Jsoup.connect("http://wlkt.nuist.edu.cn/(S(xhenbz0ghfgsredvvmwz5tav))/student/xsjbxx.aspx")
//                .headers(headMap)
//                .ignoreContentType(true)
//                .method(Connection.Method.POST)
//                .cookies(cookies)
//                .timeout(10000)
//                .ignoreHttpErrors(true)
//                .execute();
//        Document indexDocument = login.parse(); // 先获取进入班级选课页面
//        Elements tableElements =   indexDocument.getElementsByTag("table");
//        System.out.println(tableElements.get(2).getElementsByTag("tr").get(3).getElementsByTag("td").get(3));
//    }
//}